using System;
using System.Collections.Generic;
using System.Text;
using System.Web.SessionState;
using FreeLancer.HRB.Domains;

namespace FreeLancer.HRB.Core
{
  /// <summary>
  /// Wrapper of Session object
  /// </summary>
  public class SessionWrapper
  {
    private static HttpSessionState _sessionState;
    /// <summary>
    /// Set session to the Wrapper
    /// </summary>
    /// <param name="sessionState"></param>
    public static void SetSession(HttpSessionState sessionState)
    {
      _sessionState = sessionState;
    }

    private const string LanguageKey = "[Events.LanguageId]";
    /// <summary>
    /// Language Id
    /// </summary>
    public static int LanguageId
    {
      get { 
        if (_sessionState[LanguageKey] != null)
          return (int)_sessionState[LanguageKey];
        return 0;
      }
      set { _sessionState[LanguageKey] = value; }
    }
  }
}
